package com.qfedu.index.addrshow.service.controller;

import com.qfedu.index.addrshow.service.beans.City;
import com.qfedu.index.addrshow.service.service.CityService;
import com.qfedu.vo.ResultVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

@RestController
public class CityController {

    @Resource
    private CityService cityService;

    @RequestMapping(value = "/getCity",method = RequestMethod.GET)
    public ResultVo getCity() throws IOException {
        List<City> city = cityService.getOne();
        return ResultVo.getSuccessResultVo("查询城市成功",city);
    }
}
